Skip to content

fix: use aws-opentelemetry-distro and add input/output logging for LangGraph agent#552

Merged
aidandaly24 merged 2 commits intomainfrom
fix-langgraph-observability
Mar 26, 2026
Merged

fix: use aws-opentelemetry-distro and add input/output logging for LangGraph agent#552
aidandaly24 merged 2 commits intomainfrom
fix-langgraph-observability

Conversation

@tejaskash
Copy link
Copy Markdown
Contributor

@tejaskash tejaskash commented Mar 17, 2026

Summary

  • Replace generic opentelemetry-distro + opentelemetry-exporter-otlp with aws-opentelemetry-distro in the LangGraph template, matching the Strands and OpenAI Agents templates
  • Add input/output logging (log.info) to the LangGraph agent entrypoint so invocation details appear in the runtime log group

Root Cause

The LangGraph template used the generic OpenTelemetry distro which doesn't integrate with the AWS X-Ray/CloudWatch observability pipeline. This resulted in only 1 span and no input/output logs. The aws-opentelemetry-distro enables botocore auto-instrumentation that captures Bedrock model calls, tool usage, and trace context propagation.

Verified

Deployed a CodeZip LangGraph agent and confirmed:

  • Multiple spans generated (3+ unique spanIds) with opentelemetry.instrumentation.botocore.bedrock-runtime scope
  • Input/output messages visible in runtime logs with traceId correlation
  • Tool call details (function name, arguments, results) captured in OTEL logs
  • telemetry.auto.version: "0.16.0-aws" confirming AWS OTEL distro is active

Test plan

  • Snapshot tests updated and passing
  • End-to-end deploy + invoke verified with CloudWatch log inspection

Closes #551

…ngGraph agent

The LangGraph template was using the generic opentelemetry-distro which
doesn't integrate properly with AWS X-Ray and CloudWatch. This resulted
in only 1 span and no input/output logs in the runtime log group.

Switch to aws-opentelemetry-distro (matching the Strands template) to
enable proper AWS-native telemetry with botocore instrumentation that
captures Bedrock model calls, tool usage, and trace context. Also add
input/output logging to the agent entrypoint.

Fixes #551
@tejaskash tejaskash requested a review from a team March 17, 2026 21:46
@github-actions github-actions Bot added the size/xs PR size: XS label Mar 17, 2026
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Mar 17, 2026

Coverage Report

Status Category Percentage Covered / Total
🔵 Lines 45.27% 5950 / 13142
🔵 Statements 44.87% 6320 / 14083
🔵 Functions 44.5% 1109 / 2492
🔵 Branches 45.62% 3902 / 8552
Generated in workflow #1348 for commit e130074 by the Vitest Coverage Report Action

@github-actions github-actions Bot added size/xs PR size: XS and removed size/xs PR size: XS labels Mar 26, 2026
@aidandaly24 aidandaly24 merged commit f24609f into main Mar 26, 2026
21 of 24 checks passed
@aidandaly24 aidandaly24 deleted the fix-langgraph-observability branch March 26, 2026 16:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size/xs PR size: XS

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Langgraph + langchain agent does not contain input/output logs and spans

3 participants